package com.itheima.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.itheima.dao.MenuDao;
import com.itheima.dao.UserDao;
import com.itheima.pojo.Menu;
import com.itheima.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;


import java.util.List;

/*
 *@AUTHOR:LIUCHAO;
 *@DATE: 2020/9/21 20:16
 */
@Service(interfaceClass = MenuService.class)
public class MenuServiceImpl implements MenuService {
    @Autowired
    private MenuDao menuDao;

    @Autowired
    private UserDao userDao;
    @Override
    public List<Menu> findMenu(String username) {

        Integer roleId = userDao.findRoleId(username);
        List<Menu> list=menuDao.findMenuByRole(roleId);

        return list;
    }
}
